package chnegyuanneibulei;

import com.sun.xml.internal.ws.addressing.WsaTubeHelperImpl;

import javax.lang.model.element.NestingKind;

public class Student {

    //属性-----成员变量

    private  String stuName;
    private  String stuNum;
    private  Integer stuAge;

   //getter和setter接口


    public String getStuName() {
        return stuName;
    }

    public String getStuNum() {
        return stuNum;
    }

    public Integer getStuAge() {
        return stuAge;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public void setStuNum(String stuNum) {
        this.stuNum = stuNum;
    }

    public void setStuAge(Integer stuAge) {
        this.stuAge = stuAge;
    }

    /**
     *    外部类的行为
     */
    //默认构造方法
    public Student(){
        System.out.println("--Student外部类的默认构造方法");
    }
    //自定义构造方法
    public  Student(String stuName,String stuNum ,Integer stuAge){
        this.stuName = stuName;
        this.stuNum = stuNum;
        this.stuAge = stuAge;
        System.out.println("姓名："+stuName+"学号："+stuNum+"年龄"+stuAge);
        System.out.println("--Student外部类的自定义构造方法");
    }

    public  void doStuding(){
        System.out.println(this.stuName+"is studing");
    }

    //成员内部类
    class StuFamily{

        //成员内部类属性
        private String stuMotherName;
        private String stuFatherName;
        private Integer stuFamilyPhone;

        /**
         *      成员内部类行为
         */

        //默认构造方法
        public  StuFamily(){   System.out.println("--StuFamily内部类的默认构造方法");}

        //三个参数的成员内部类自定义构造方法
        public  StuFamily(String stuMotherName,String stuFatherName,Integer stuFamilyPhone){
            this.stuMotherName = stuMotherName;
            this.stuFatherName = stuFatherName;
            this.stuFamilyPhone = stuFamilyPhone;
            System.out.println("妈妈的姓名："+stuMotherName+"爸爸的姓名："+stuFatherName+"电话号码"+stuFamilyPhone);
            System.out.println("--StuFamily内部类的自定义构造方法");
        }

        public void printFamilyInfo(){
            System.out.println("学生姓名："+stuName);
            System.out.println("学生的家庭信息：");
        }
        //成员内部类的getter和setter接口方法
        public String getStuMotherName() {
            return stuMotherName;
        }

        public String getStuFatherName() {
            return stuFatherName;
        }

        public Integer getStuFamilyPhone() {
            return stuFamilyPhone;
        }

        public void setStuMotherName(String stuMotherName) {
            this.stuMotherName = stuMotherName;
        }

        public void setStuFatherName(String stuFatherName) {
            this.stuFatherName = stuFatherName;
        }

        public void setStuFamilyPhone(Integer stuFamilyPhone) {
            this.stuFamilyPhone = stuFamilyPhone;
        }
    }



}
